Python Script
A Python Script allows you to write a script for manipulating components, commands and the application using Python programming language (stackless, version 2.7).
Properties
Name | Description |
Name | Defines the name of the script. |
Script | Allows you to view and edit the script in an editor. |
Editor
In order to access the script editor, do one of the following:
- In the Component Graph panel, Component Node Tree, find the Python Script behavior you want to edit, and then double-click that behavior.
- In the Properties panel, click Open In Editor.
The script editor displays line numbers, expand/collapse options for code blocks, and a toolbar.
Name | Description |
Compile | ![]() |
Trace Execution | ![]() |
Run to cursor | ![]() |
Step 1 line | ![]() |
Snippets | ![]() |
Cut | ![]() |
Copy | ![]() |
Paste | ![]() |
Undo | ![]() |
Redo | ![]() |
Background | ![]() |
Find | ![]() |
Find Next | ![]() |
Find Previous | ![]() |
Highlight All Matches | ![]() |
Clear Highlights | ![]() |
Snippets
The initial content of the editor contains a code snippet that allows you to use the properties, methods and events of the script's behavior:
from vcScript import * def OnSignal( signal ): pass def OnRun(): pass |
If the text area is active, you can press CTRL+J to insert a snippet of code.
Word Completion
The editor allows you to use autocomplete for certain types of cases. For example, if the text area is active, you can press CTRL+SPACEBAR to display options for completing a line of code.
If you use autocomplete, you may be able to read documentation about the added item.